<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>退货记录列表</title>


<link href="${base}/resources/admin/css/amazeui.css" rel="stylesheet" type="text/css" /><link href="${base}/resources/admin/css/common.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${base}/resources/admin/js/jquery.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/common.js"></script>
<script type="text/javascript" src="${base}/resources/admin/js/list.js"></script> <script type="text/javascript" src="${base}/resources/admin/js/amazeui.min.js"></script>
<script type="text/javascript">
$().ready(function() {

    var $listForm = $("#listForm");
    var $filterSelect = $("#filterSelect");
    var $filterOption = $("#filterOption a");

	[@flash_message /]

    // 退货筛选
    $filterSelect.mouseover(function() {
        var $this = $(this);
        var offset = $this.offset();
        var $menuWrap = $this.closest("div.menuWrap");
        var $popupMenu = $menuWrap.children("div.popupMenu");
        $popupMenu.css({left: offset.left, top: offset.top + $this.height() + 2}).show();
        $menuWrap.mouseleave(function() {
            $popupMenu.hide();
        });
    });

    // 筛选选项
    $filterOption.click(function() {
        var $this = $(this);
        var $dest = $("#" + $this.attr("name"));
        if ($this.hasClass("checked")) {
            $dest.val("");
        } else {
            $dest.val($this.attr("val"));
        }
        $listForm.submit();
        return false;
    });
});
</script>
</head>
<body>
	<div class="path">
		<a href="${base}/asl-admin/common/index.htm">${message("admin.path.index")}</a> &raquo; 退货记录列表 <span>(${message("admin.page.total", page.total)})</span>
	</div>
	<form id="listForm" action="list.htm" method="get">
		<div class="bar">
			[#--<a href="add.htm" class="iconButton" id="addButton">
				<i class="iconfont icon-anonymous-iconfont1">&nbsp;</i>${message("admin.common.add")}
			</a>--]
			<div class="buttonWrap">
				<a href="javascript:" id="deleteButton" class="iconButton disabled">
					<i class="iconfont icon-icon27">&nbsp;</i>${message("admin.common.delete")}
				</a>
				<a href="javascript:" id="refreshButton" class="iconButton">
					<i class="iconfont icon-shuaxin1">&nbsp;</i>${message("admin.common.refresh")}
				</a>
                <div class="menuWrap">
                    <a href="javascript:" id="filterSelect" class="button">
					退换货申请筛选<span class="arrow">&nbsp;</span>
                    </a>
                    <div class="popupMenu">
                        <ul id="filterOption" class="check">
                            <li>
                                <a href="javascript:" name="status" val="apply"[#if status == "apply"] class="checked"[/#if]>申请中</a>
                            </li>
                            <li>
                                <a href="javascript:" name="status" val="reject"[#if status == "reject"] class="checked"[/#if]>拒绝</a>
                            </li>
                            <li>
                                <a href="javascript:" name="status" val="deal"[#if status == "deal"] class="checked"[/#if]>已处理</a>
                            </li>
                            <li class="separator">
                                <a href="javascript:" name="reason" val="product"[#if reason == "product"] class="checked"[/#if]>商品问题</a>
                            </li>
                            <li>
                                <a href="javascript:" name="reason" val="mistake"[#if reason == "mistake"] class="checked"[/#if]>购买错误</a>
                            </li>
                            <li>
                                <a href="javascript:" name="reason" val="nowant"[#if reason == "nowant"] class="checked"[/#if]>不想买</a>
                            </li>
                            <li>
                                <a href="javascript:" name="reason" val="no"[#if reason == "no"] class="checked"[/#if]>没有原因</a>
                            </li>
                        </ul>
                    </div>
                </div>
				<div class="menuWrap">
					<a href="javascript:" id="pageSizeSelect" class="button">
						${message("admin.page.pageSize")}<span class="arrow">&nbsp;</span>
					</a>
					<div class="popupMenu">
						<ul id="pageSizeOption">
							<li>
								<a href="javascript:"[#if page.pageSize == 10] class="current"[/#if] val="10">10</a>
							</li>
							<li>
								<a href="javascript:"[#if page.pageSize == 20] class="current"[/#if] val="20">20</a>
							</li>
							<li>
								<a href="javascript:"[#if page.pageSize == 50] class="current"[/#if] val="50">50</a>
							</li>
							<li>
								<a href="javascript:"[#if page.pageSize == 100] class="current"[/#if] val="100">100</a>
							</li>
						</ul>
					</div>
				</div>
			</div>
			<div class="menuWrap">
				<div class="search">
					<span id="searchPropertySelect" class="arrow">&nbsp;</span>
					<input type="text" id="searchValue" name="searchValue" value="${page.searchValue}" maxlength="200" />
					<button type="submit">&nbsp;</button>
				</div>
				<div class="popupMenu">
					<ul id="searchPropertyOption">
						<li>
							<a href="javascript:"[#if page.searchProperty == "orderItem.order.sn"] class="current"[/#if] val="orderItem.order.sn">所属订单编号</a>
						</li>
						<li>
							<a href="javascript:"[#if page.searchProperty == "member.username"] class="current"[/#if] val="member.username">用户</a>
						</li>
					</ul>
				</div>
			</div>
		</div>
		<table id="listTable" class="list">
			<tr>
				<th class="check">
					<input type="checkbox" id="selectAll" />
				</th>
				<th>
					<a href="javascript:" class="sort" name="orderItem.order.sn">所属订单编号</a>
				</th>
                <th>
                    <a href="javascript:" class="sort" name="member.username">用户</a>
                </th>
                <th>
                    <a href="javascript:" class="sort" name="orderItem.fullName">商品全称</a>
                </th>
                <th>
                    <a href="javascript:" class="sort" name="quantity">退货数量</a>
                </th>
                <th>
                    <a href="javascript:" class="sort" name="status">退货状态</a>
                </th>
                <th>
                    <a href="javascript:" class="sort" name="reason">退货原因</a>
                </th>
                <th>
                    <a href="javascript:" class="sort" name="description">备注</a>
                </th>
				<th>
                    <span>${message("admin.common.handle")}</span>
                </th>
			</tr>
			[#list page.content as returns_record]
				<tr>
					<td>
						<input type="checkbox" name="ids" value="${returns_record.id}" />
					</td>
					<td>
						<a href="/asl-admin/order/view.htm?id=${returns_record.orderItem.order.id}">${returns_record.orderItem.order.sn}</a>
					</td>
					<td>
						${returns_record.member.username}(${returns_record.member.name!"暂无"})
					</td>
					<td>
						${returns_record.orderItem.fullName}
					</td>
					<td>
						${returns_record.quantity}
					</td>
                    <td>
						[#if returns_record.status??]${returns_record.status.toValue()}[#else]暂无[/#if]
                    </td>
                    <td>
						[#if returns_record.reason??]${returns_record.reason.toValue()}[#else]暂无[/#if]
                    </td>
					<td>
						${returns_record.description}
					</td>
					<td>
						[#--<a href="edit.htm?id=${returns_record.id}"><i class="iconfont icon-bianji edit-icon" ></i></a>--]
						<a href="view.htm?id=${returns_record.id}" ><i class="iconfont icon-sou view-icon"></i></a>
					</td>
				</tr>
			[/#list]
		</table>
		[@pagination pageNumber = page.pageNumber totalPages = page.totalPages]
			[#include "/admin/include/pagination.ftl"]
		[/@pagination]
	</form>
</body>
</html>
